﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using EIIS.FrameWork.Repository;
using EIIS.Infrastructure.Model.System.Authority;

namespace EIIS.Infrastructure.Repositories.System.Authority
{
    public interface IHospUserRepository : IRepository<HospUser>
    {
        /// <summary>
        /// 更新用户密码
        /// </summary>
        /// <param name="strLoginName">登录名</param>
        /// <param name="strNewPassword">新密码</param>
        /// <returns></returns>
        bool UpdatePasswordByName(string strLoginName, string strNewPassword);
        /// <summary>
        /// 更新用户密码
        /// </summary>
        /// <param name="strId">用户ID</param>
        /// <param name="strNewPassword">新密码</param>
        /// <returns></returns>
        bool UpdatePasswordByID(string strId, string strNewPassword);
        /// <summary>
        /// 获取用户
        /// </summary>
        /// <param name="strLoginName">根据登录名获取用户</param>
        /// <returns></returns>
        HospUser GetUserByName(string strLoginName);
        /// <summary>
        /// 验证用户
        /// </summary>
        /// <param name="strLoginName">登录名</param>
        /// <param name="strPassword">密码</param>
        /// <returns></returns>
        bool ValidateByName(string strLoginName, string strPassword);
        /// <summary>
        /// 验证用户
        /// </summary>
        /// <param name="strId">用户ID</param>
        /// <param name="strPassword">密码</param>
        /// <returns></returns>
        bool ValidateByID(string strId, string strPassword);
        /// <summary>
        /// 获取用户数据集
        /// </summary>
        /// <param name="total">总数</param>
        /// <param name="page">页码</param>
        /// <param name="rows">每页记录数</param>
        /// <param name="order">排序字段</param>
        /// <param name="sort">排序规则：asc,desc</param>
        /// <returns></returns>
        IQueryable<HospUser> LoadAllWithPage(out long total, int page, int rows, string order, string sort);
    }
}
